#include "../source/http/http.h"
#include "../source/log.h"
#include <iostream>
#include <memory>

void test_request()
{
    MYHTTP::HttpRequest::ptr req = std::make_shared<MYHTTP::HttpRequest>();
    req->setHeader("host", "www.baidu.com");
    req->setBody("hello world");
    log_debug("\n{}", req->toString());
}

void test_response()
{
    MYHTTP::HttpResponse::ptr rsp = std::make_shared<MYHTTP::HttpResponse>();
    rsp->setHeader("X-X", "lalala");
    rsp->setBody("hello world");
    rsp->setStatus((MYHTTP::HttpStatus)400);
    rsp->setClose(false);
    log_debug("\n{}", rsp->toString());
}

int main(void)
{
    test_request();
    test_response();

    return 0;
}